# Copyright (c) 2017 Presto Labs Pte. Ltd.
# Author: jaewon


import json
import logging
import os

from coin2.support.product_info.spot_binance_v1 import convert_coin1_constants


pi_file = 'data/coin2/product_info/old_compat/binance.json'
with open(pi_file) as f:
  static_constants = convert_coin1_constants(json.load(f)['product_infos'])
coin_only_exchange = True

dynamic_constants = {}
if int(os.getenv('USE_DYNAMIC_SYMBOL', 0)):
  try:
    from coin2.support.product_info.spot_binance_v1 import gen_coin1_constants
    dynamic_constants = gen_coin1_constants()
  except Exception as e:
    logging.error('Failed to use binance dynamic symbols! %s', e)

quote_currency_list = list(set(
    static_constants.get('quote_currency_list', []) +
    dynamic_constants.get('quote_currency_list', [])))
currency_list = list(set(
    ['BCC', 'BCHABC'] +
    static_constants.get('currency_list', []) +
    dynamic_constants.get('currency_list', [])))
symbol_list = list(set(
    static_constants.get('symbol_list', []) +
    dynamic_constants.get('symbol_list', [])))
